package com.yanqu.road.entity.activity.foxcard.config;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.string.StringUtils;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_fox_card")
public class FoxCardEffectCardConfig {
    @FieldTypeAnnotation(select = true, orderASC = true, isIndex = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "卡片id", isIndex = true)
    private int id;
    @FieldTypeAnnotation(desc = "流派")
    private String build;
    @FieldTypeAnnotation(desc = "品质")
    private int quality;
    @FieldTypeAnnotation(desc = "类型")
    private int type;
    @FieldTypeAnnotation(desc = "效果参数列表")
    private String params;
    @FieldTypeAnnotation(desc = "升级效果参数列表")
    private String upgradeParams;
    @FieldTypeAnnotation(desc = "是否可以升级")
    private int canUp;
    @FieldTypeAnnotation(desc = "商店价格")
    private int price;
    @FieldTypeAnnotation(desc = "形象")
    private String appearance;
    @FieldTypeAnnotation(desc = "是否初始卡")
    private int isInitial;
    @FieldTypeAnnotation(desc = "名称")
    private String name;
    @FieldTypeAnnotation(desc = "描述")
    private String desc;
    @FieldTypeAnnotation(desc = "效果表现参数")
    private String showParams;
    @FieldTypeAnnotation(desc = "效果表现参数")
    private String showUpgradeParams;
    @FieldTypeAnnotation(desc = "是否可被复制")
    private int canCopy;

//  条件值  筹码	乘算筹码	倍率	乘算倍率	金币
    private List<String> paramsList = new ArrayList<>();
//    筹码	乘算筹码	倍率	乘算倍率	金币
    private List<Integer> upgradeParamsList = new ArrayList<>();

    public FoxCardEffectCardConfig(ResultSet rs) throws SQLException {
        this.activityId = rs.getInt("activityId");
        this.id = rs.getInt("id");
        this.build = rs.getString("build");
        this.quality = rs.getInt("quality");
        this.type = rs.getInt("type");
        this.params = rs.getString("params");
        this.upgradeParams = rs.getString("upgradeParams");
        this.canUp = rs.getInt("canUp");
        this.price = rs.getInt("price");
        this.appearance = rs.getString("appearance");
        this.isInitial = rs.getInt("isInitial");
        this.name = rs.getString("name");
        this.desc = rs.getString("desc");
        this.showParams = rs.getString("showParams");
        this.showUpgradeParams = rs.getString("showUpgradeParams");
        this.canCopy = rs.getInt("canCopy");

        this.paramsList = StringUtils.stringToStringList(params, "\\|");
        this.upgradeParamsList = StringUtils.stringToIntegerList(upgradeParams, "\\|");
    }

    public int getId() {
        return id;
    }

    public String getBuild() {
        return build;
    }

    public int getQuality() {
        return quality;
    }

    public int getType() {
        return type;
    }

    public String getParams() {
        return params;
    }

    public String getUpgradeParams() {
        return upgradeParams;
    }

    public int getCanUp() {
        return canUp;
    }

    public int getPrice() {
        return price;
    }

    public String getAppearance() {
        return appearance;
    }

    public int getIsInitial() {
        return isInitial;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    public int getActivityId() {
        return activityId;
    }

    public List<String> getParamsList() {
        return paramsList;
    }

    public List<Integer> getUpgradeParamsList() {
        return upgradeParamsList;
    }

    public String getShowParams() {
        return showParams;
    }

    public String getShowUpgradeParams() {
        return showUpgradeParams;
    }
    public int getCanCopy() {
        return canCopy;
    }
}